Skip to content

Feat/sdbql set operations - #7

Merged
solisoft merged 2 commits into
mainfrom
feat/sdbql-set-operations
Aug 24, 2026
Merged

Feat/sdbql set operations#7
solisoft merged 2 commits into
mainfrom
feat/sdbql-set-operations

Conversation

@solisoft

Copy link
Copy Markdown
Owner

No description provided.

solisoft and others added 2 commits August 24, 2026 20:53
… KEEP, NONE, OFFSET

Query blocks combine with UNION [ALL] / INTERSECT / EXCEPT. Either side may be
parenthesized, chains follow SQL precedence (INTERSECT binds tighter than
UNION/EXCEPT, which chain left to right), and rows compare by value — the same
equality the UNION()/INTERSECTION() array builtins use.

WITH RECURSIVE name AS (<anchor> UNION ALL <step>) iterates the step until it
stops producing rows, binding the CTE name inside the step to the previous
iteration's rows, capped at 1,000 iterations / 1M rows.

Also: RETURN DISTINCT, COLLECT ... INTO g KEEP v1, v2 (an unknown name is an
error), the NONE quantifier and its NONE(arr, x -> cond) function form, and
OFFSET standalone or as LIMIT n OFFSET m.

Nested query blocks are no longer second-class: CTE bodies, set-operation
operands, recursive anchors/steps and correlated subqueries all run through one
entry point, so their own WITH, pre-FOR LETs, SORT/LIMIT and nested set
operations apply. A CTE declared before a set operation binds in every operand
and is evaluated once. RETURN DISTINCT is applied after the pipeline, so every
fast path honours it, columnar collections included.

LimitClause.count is Option<Expression>: a standalone OFFSET has no count
rather than a sentinel maximum, which used to reach scan_values_range as an
allocation hint and panic with "capacity overflow".

Permission checks, query caching, cache invalidation, the long-running-query
gate and has_mutations() all see through set-operation operands and CTE bodies,
so a mutation cannot hide in one and be served from cache or skip a
transaction's WAL and locks.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…g depth

The chip's branch on a null count nested one level too deep for
smell/deep-nesting. Compute the label first, render one expression.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@solisoft
solisoft merged commit 7dee707 into main Aug 24, 2026
7 checks passed
solisoft added a commit that referenced this pull request Aug 24, 2026
…ssword-policy fixes

Brings in the three admin-app fixes made after PR #7 merged: the custom
timeseries prune cutoff no longer 500s, explain_expr can compile its
regexes again, and the users spec plus the new-user form match the
server's 12-character password minimum.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant